var list;

var hostname="http://10.1.1.107:8888/";
//var hostname="http://192.168.1.4:8888/";
//var hostname="http://localhost:8888/";

$(document).ready(function() {
    $("#hitBGE").click(function(event){
    	 getList();
    });
});

$(document).bind("mobileinit", function(){
	$.mobile.silentScroll(100);
	$('div').live('pageshow',function(event, ui){
		var localWindow = window;
		var localLocation = localWindow.location;
		if((localLocation.hash).indexOf("menu.html", 0)>=0
			|| (localLocation.pathname).indexOf("menu.html", 0)>=0
		){
			getList();
		}
	});
});

function getList(){
//	if(list!=null)return;
	$.mobile.pageLoading();
	var urlString = hostname + "bellygoodengine.json";
	  $.getJSON(urlString, function(result) {
		  list = result;
		  $.mobile.pageLoading(true);	
		  addToList();
	  });
}

function addToList(){
//	$("#header").append("<h1>HELLO</h1>");
}

// .phonegap.com

function getPicture(sourceType)
{
     var options = { quality: 10 };
     if (sourceType != undefined) {
          options["sourceType"] = sourceType;
     }
     // if no sourceType specified, the default is CAMERA 
     navigator.camera.getPicture(getPicture_Success, null, options);
};
 
function getPicture_Success(imageData)
{
         alert("getpic success");
        //document.getElementById("test_img").src = "data:image/jpeg;base64," + imageData;
}